// import { ProFormUploadDragger } from '@ant-design/pro-form';
import React, { useEffect, useState } from "react";
import { Menu, Dropdown, Button, message, Space, Input, Table} from 'antd';
import "./index.css"
import axios from "axios"
// 表格
const rowSelection = {
    onChange: (selectedRowKeys: any, selectedRows: any) => {
        console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
    },
    onSelect: (record: any, selected: any, selectedRows: any) => {
        console.log(record, selected, selectedRows);
    },
    onSelectAll: (selected: any, selectedRows: any, changeRows: any) => {
        console.log(selected, selectedRows, changeRows);
    },
};
const Comment = () => {
    let [data, setData] = useState([])
    useEffect(() => {
        axios.get('https://creationapi.shbwyz.com/api/comment?page=1&pageSize=12').then((res) => {
            setData(res.data.data)
            console.log(res);
        })
    }, [])
    const columns: any = [
        {
            title: '发件人',
            width: 320,
            dataIndex: 'name',
            key: 'name',
            // fixed: 'left',
        },
        {
            title: '收件人',
            dataIndex: 'address',
            key: '1',
            width: 325,
        },
        {
            title: '主题',
            dataIndex: 'address',
            key: '2',
            width: 244,
        },
        {
            title: '发送时间',
            dataIndex: 'address',
            key: '3',
            width: 382,
        },
        {
            title: '操作',
            key: 'operation',
            // fixed: 'right',
            width: 135,
            render: () => <p><a>删除</a></p>,
        },
    ];
    // for (let i = 0; i < 100; i++) {
    //     data.push({
    //         key: i,
    //         name: `Edrward ${i}`,
    //         address: `London Park no. ${i}`,
    //     });
    // }
    return (
        <div className="box">
 <div className="head">
                <span style={{ color: "#8C8C8C" }}>工作台&emsp;/&emsp;</span>
                海报管理
            </div>
            <div className="leg"><br />
                <div className="legone">
                    &emsp;<span>文件人&nbsp;:</span>&emsp;
                    <Input placeholder="请输入文件人" style={{width:"222px",height:"32px"}}/>
                    &emsp;  &emsp; &emsp;<span>收件人&nbsp;:</span>&emsp;
                    <Input placeholder="请输入收件人" style={{width:"222px",height:"32px"}}/>
                    &emsp;&emsp; &emsp;<span>主题&nbsp;:</span>&emsp;
                    <Input placeholder="请输入主题" style={{width:"222px",height:"32px"}}/>
                </div>
                <div className="legtwo">
                    <div></div>
                    <div><Button type="primary" className="btns">搜 索</Button>
                    <Button className="btnc">重 置</Button></div>
                    
                </div>
            </div><br />
            <div>

            <Table rowSelection={rowSelection} columns={columns} dataSource={data} scroll={{ x: 1500, y: 500 }} />,

            </div>
        </div>
    )
}
export default Comment